package com.mszlu.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mszlu.blog.common.Result;
import com.mszlu.blog.dao.CategoryDAO;
import com.mszlu.blog.entity.Category;
import com.mszlu.blog.service.CategoryService;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryDAO, Category> implements CategoryService {
    @Override
    public Result detail(long id) {
        LambdaQueryWrapper<Category> lambdaQueryWrapper = new LambdaQueryWrapper<>();

        lambdaQueryWrapper.eq(Category::getId,id);

        Category one = this.getOne(lambdaQueryWrapper);

        return Result.success(one);
    }
}
